package com.hen.web.henweb.common;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * @author 狠穿
 * @version 1.0.0
 * @date 2023/4/30
 * @function 分页对象
 */
public class Pageable<T> {

    private int page = 1;
    private int pageSize = 10;

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public Pageable() {
    }

    public Pageable(int page, int pageSize) {
        this.page = page;
        this.pageSize = pageSize;
    }

    /**
     * 将自定义的分页对象转换成mp的对象
     * @return
     */
    public Page toPage(){
        return new Page<>(page,pageSize);
    }
}
